// this class creates the list view for main screen

package com.example.helloandroid;


import java.util.ArrayList;
import java.util.Arrays;

import android.app.ListActivity;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class ListViewWidget extends ListActivity {
	private ArrayAdapter<String> aa;
	private ArrayList<String> listSongs;
	private ListView listView;
	private String[] songs;
	private TextView selectedSongText;
    /** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
	  super.onCreate(savedInstanceState);
	  addWidgets();
	  addAdapter();
	  setListeners();
	  };
	  @Override
protected void onListItemClick(ListView aL, View aV, int aPosition, long aId){
	super.onListItemClick(aL, aV, aPosition, aId);
	selectedSongText.setText(listSongs.get(aPosition));
}
private void addAdapter(){
	Resources aResources = this.getResources();
	songs = aResources.getStringArray(R.array.songs);
	listSongs = new ArrayList<String>(Arrays.asList(songs));
	aa = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, listSongs);
	setListAdapter(aa);
}

private void addWidgets(){
	selectedSongText = (TextView)this.findViewById(R.id.songText);
	listView = getListView();
	
	
}

public void setListeners(){
	
}
	  
}